Repository navigation
feat(c): expose TableWrite close for explicit cleanup - #1306
Conversation
Looks like unrelatd failure |
@ZENOTME The |
103421c to
fabf5bd
Compare
| } | ||
| } | ||
|
|
||
| /// Close a standard TableWrite, discarding outstanding output without preparing a commit. |
There was a problem hiding this comment.
[P2] Document the I/O and failure semantics of close
#1302 asks for cancellation without flushing unprepared output. This wrapper calls TableWrite::close(), whose append path finishes the active Parquet writer before attempting to delete its file. Cleanup errors are discarded by core and the C function still returns success.
I reproduced this via the C write and close APIs with an instrumented storage provider. The unprepared object was absent before close. Close wrote it and then attempted deletion. With an injected deletion denial, close returned null and the object remained. With successful deletion, it disappeared. In both runs, the previously prepared message still committed and only its row was visible.
Please describe this API as best-effort cleanup that can finish and upload buffered output and that does not report storage cleanup errors. If cancellation without flushing is required for #1302, it needs a separate core abort path.
3cf4a06 to
5fa62a0
Compare
| } | ||
| } | ||
|
|
||
| /// Close a standard TableWrite, discarding unprepared output on a best-effort basis. |
There was a problem hiding this comment.
[P2] Document that close may flush buffered output
Please clarify that close() may finish and upload buffered output before attempting deletion. The append path calls writer.close().await during abort, so callers cannot rely on this API for cancellation without flushing. The current text explains cleanup failures but omits this I/O behavior. A documentation clarification is sufficient for this PR.
5fa62a0 to
ca31a34
Compare
Purpose
Expose existing
TableWrite::close()through the C API for explicit cleanup. Closes #1302.Brief change log
Add
paimon_table_write_close()using existing C binding conventions. Prepared messages remain caller-owned; free the handle separately.Tests
Reuse
test_write_commit_read_roundtrip: close the writer before committing its prepared messages, then verify the existing readback. No new fixture. Formatting checks pass.API and Format
One additive C function; no storage format changes.
Documentation
Rustdoc describes ownership and handle lifetime.